<!DOCTYPE html>
<html  xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="UTF-8">
    <title th:text="${category==null?'目录':category}">目录</title>
    <link rel="stylesheet" href="/webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="/webjars/jquery/1.11.1/jquery.min.js"></script>
    <script src="/webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        .aside {
            width: 20%;
            float: left;
            height: 100%;
            overflow: scroll;
        }
        .content {
            width: 80%;
            float: left;
            height: 100%;
        }
        .p {
            height: 100vh;
        }
    </style>
</head>
<body>
    <div class="clear p">
        <div class="aside">
            <ul class="list-group">
                <th:block th:each="item:${categories}">
                    <a th:href="${item.url}" th:class="${item.name == category?'active list-group-item':'list-group-item'}" th:text="${item.name}"></a>
                </th:block>
            </ul>
        </div>
        <div class="content">
            <ul class="list-group">
                <th:block th:each="item:${books}">
                    <a th:href="${item.url}" class="list-group-item" th:text="${item.bookName}"></a>
                </th:block>
            </ul>
        </div>
    </div>
</body>
</html>